<!doctype html>
<html>
<head>
    <title id="title">logWeb-node</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <link rel="stylesheet" href="node_modules/xterm/dist/xterm.css"/>
    <link rel="stylesheet" href="node_modules/xterm/dist/addons/fullscreen/fullscreen.css"/>
    <link rel="stylesheet" href="public/stylesheets/style.css"/>
    <link rel="shortcut icon" id="favicon" href="public/imgs/blue24.png"
          type="image/x-icon"/>
    <script src="public/javascripts/es6-promise.auto.min.js"></script>
    <script src="public/javascripts/fetch.min.js"></script>
    <script src="node_modules/xterm/dist/xterm.js"></script>

    <script src="node_modules/xterm/dist/addons/attach/attach.js"></script>
    <script src="node_modules/zmodem.js/dist/zmodem.js"></script>
    <script src="public/javascripts/zmodem.js"></script>

    <script src="node_modules/xterm/dist/addons/fit/fit.js"></script>
    <script src="node_modules/xterm/dist/addons/fullscreen/fullscreen.js"></script>
    <script src="node_modules/xterm/dist/addons/search/search.js"></script>
    <style>
        .xterm.fullscreen {
            margin-bottom: 34px;
        }
    </style>
</head>
<body style="margin: 8px;">
<h1>enter into a spiderweb node from browser !</h1>

<div id="terminal-container"></div>

<div id="zmodem_controls">
    <form id="zm_start" style="display: none" action="javascript:void(0)">
        ZMODEM detected: Start ZMODEM session?
        <label><input id="zmstart_yes" name="zmstart" type=radio checked value="1"> Yes</label>
        &nbsp;
        <label><input name="zmstart" type=radio value=""> No</label>
        <button type="submit">Submit</button>
    </form>

    <form id="zm_offer" style="display: none" action="javascript:void(0)">
        <p>ZMODEM File offered!</p>

        <label><input id="zmaccept_yes" name="zmaccept" type=radio checked value="1"> Accept</label>
        &nbsp;
        <label><input name="zmaccept" type=radio value=""> Skip</label>
        <button type="submit">Submit</button>
    </form>

    <div id="zm_file" style="display: none">
        <div>Name: <span id="name"></span></div>
        <div>Size: <span id="size"></span></div>
        <div>Last modified: <span id="mtime"></span></div>
        <div>Mode: <span id="mode"></span></div>
        <br>

        <div>Conversion: <span id="zfile_conversion"></span></div>
        <div>Management: <span id="zfile_management"></span></div>
        <div>Transport: <span id="zfile_transport"></span></div>
        <div>Sparse? <span id="zfile_sparse"></span></div>
        <br>

        <div>Files remaining in batch: <span id="files_remaining"></span></div>
        <div>Bytes remaining in batch: <span id="bytes_remaining"></span></div>
    </div>

    <form id="zm_progress" style="display: none" action="javascript:void(0)">
        <div><span id="percent_received"></span>% (<span id="bytes_received"></span> bytes) received</div>
        <button id="zm_progress_skipper" type="button" onclick="skip_current_file();">Skip File</button>
    </form>

    <form id="zm_choose" style="display: none" action="javascript:void(0)">
        <label>Choose file(s): <input id="zm_files" type="file" multiple></label>
    </form>

</div>
<script src="public/javascripts/main.js" defer></script>
<div style="position: absolute;z-index: 999; bottom: 0;width: 100%;margin-left: -8px;padding: 6px; height: 34px;background-color:rgb(229,229,229);box-sizing: border-box;">
    <input id="command" type="text" placeholder="发送命令到所有已打开控制台,回车键发送" style="width: 100%;font-size:14px;padding: 2px; box-sizing: border-box;border: 1px solid #ccc;box-shadow: none;border-radius: 0;">
</div>
</body>
</html>
